import request from '@/utils/request'

export function getCompanyInfo(id) {
  return request({
    url: `/company/${id}`
  })
}

// /sys/role
export function getRole(params) {
  return request({
    url: `/sys/role`,
    params
  })
}

// /sys/role/{id}
export function delRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

export function addRole(data) {
  return request({
    url: `/sys/role`,
    method: 'post',
    data
  })
}

export function getRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`
  })
}

export function editRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}

export function assignPrem(data) {
  return request({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}
